package com.ssh.tts.cui;

import java.util.List;
import java.util.Objects;
import java.util.Scanner;

import com.ssh.tts.model.IUser;

public class SelectCUI {
	public static void firstSelect() {
		String selected="";
		Scanner input=new Scanner(System.in);
		do {
			System.out.println("欢迎进入12306山寨网，请选择您需要的服务！");
			System.out.println("1....查询车票");
			System.out.println("2....购买车票");
			System.out.println("3....退票");
			System.out.println("4....注册");
			System.out.println("5....退出");
			System.out.print("请选择：");
			selected = input.next();
			switch(selected) {
				case "1" :	TrainCUI.trainQuery();break;
				case "2" :	{
								List<IUser> user = UserCUI.login();
								TrainCUI.trainQuery();
								TrainCUI.buyTrain(user);
								break;
							}
				case "3" :	{
								List<IUser> user = UserCUI.login();
								TrainCUI.queryByUser_id(user);
								TrainCUI.refundTrain(user);
								break;
							}
				case "4" : 	UserCUI.registerUser();break;
				case "5" :	break;
				default  : System.out.println("请输入正确的选项！");;
			}
			
		}while(!Objects.equals(selected, "5"));
		//input.close();
	}
}
